Skip to content

Conversation

lbushi25
Copy link
Contributor

@lbushi25 lbushi25 commented Aug 12, 2025

This PR disables dead argument elimination for free function kernels. When using a free function kernel, the user sets the arguments manually using handler::set_arg but if certain arguments are optimized away in case they are not used, the implementation needs to be aware of this and remove the relevant set_arg calls. Instead, its much more feasible to just disable dead arg elimination in this case.

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a LIT test for the change, see llvm/test/Transforms/DeadArgElim/sycl-kernels.ll for an example of existing test

@aelovikov-intel
Copy link
Contributor

I've removed reference to the internal bug report from the PR's description. That's not how upstream development should be done.

That said, the rest of the description was great and provides enough context for the change, so no additional actions needed.

@aelovikov-intel
Copy link
Contributor

Something is wrong with codeownership. I'd expect llvm to be owned by @intel/dpcpp-tools-reviewers , not by @intel/llvm-reviewers-runtime .

@lbushi25 lbushi25 requested a review from a team as a code owner August 13, 2025 18:48
@lbushi25
Copy link
Contributor Author

Re-requested review since this is high priority in the context of the next release.

Comment on lines +176 to +179
// Variadic template functions do not work with free function kernels. See
// CMPLRLLVM-69528.
// TODO: Uncomment the following line once the tracker is resolved.
// test_func<variadic_templated<double>, double>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave review of this to @AlexeySachkov.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression from this patch, or is it something previously known?

Copy link
Contributor Author

@lbushi25 lbushi25 Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression from this patch, or is it something previously known?

I believe it's previously known. The failure described by the tracker has been happening since the test was created, it just wasn't caught by pre-commit since it only manifests with optimizations disabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression from this patch, or is it something previously known?

I believe it's previously known. The failure described by the tracker has been happening since the test was created, it just wasn't caught by pre-commit since it only manifests with optimizations disabled.

Ideally, such test should be disabled in a separate PR not to cause confusion, but I'm fine with the change since we do have a tracker to analyze the issue

Comment on lines +176 to +179
// Variadic template functions do not work with free function kernels. See
// CMPLRLLVM-69528.
// TODO: Uncomment the following line once the tracker is resolved.
// test_func<variadic_templated<double>, double>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression from this patch, or is it something previously known?

Co-authored-by: Alexey Sachkov <[email protected]>
Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on @AlexeySachkov 's comment.

Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though there are no remaining clang FE changes, looks like my approval is still needed for this PR.

The changes look good to me.

@lbushi25
Copy link
Contributor Author

lbushi25 commented Aug 25, 2025

Both failing pre-commit jobs are failing at downloading the toolkit. Weirdly, re-running does not seem to fix it so it seems to be some persistent infrastructure bug. Either way, not related to my changes for sure.

@intel/llvm-gatekeepers Can you merge this please?

@lbushi25
Copy link
Contributor Author

Both failing pre-commit jobs are failing at downloading the toolkit. Weirdly, re-running does not seem to fix it so it seems to be some persistent infrastructure bug. Either way, not related to my changes for sure.

@intel/llvm-gatekeepers Can you merge this please?

Seems like one more review needed for this to get merged. Ignore for now please!

@lbushi25
Copy link
Contributor Author

Failures unrelated, see #19767
@intel/llvm-gatekeepers Can you merge please?

@uditagarwal97 uditagarwal97 merged commit 430a3b3 into intel:sycl Aug 26, 2025
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants